import { Component, OnInit } from '@angular/core';
import { Overlay } from "@angular/cdk/overlay";
import { CustomComponent } from '../custom/custom.component';
import { ComponentPortal } from '@angular/cdk/portal';
@Component({
  selector: 'app-popup',
  templateUrl: './popup.component.html',
  styleUrls: ['./popup.component.scss']
})
export class PopupComponent implements OnInit {

  constructor(
    private overlay: Overlay
  ) { }

  ngOnInit(): void {
  }

  openPopup() {
    // console.log(this.overlay);
    const container = this.overlay.create();
    const componentPortal = new ComponentPortal(CustomComponent);
    container.attach(componentPortal);
    console.log(container);
  }

}
